package day02.edu;

// Created: 09/02/2025, ChangJiang Ru
public class ColorTest {
    public static void main(String[] args) {
        System.out.println(Color.RED);
        System.out.println(Color.BLUE);
        System.out.println(Color.PURPLE);
        System.out.println(Color.CYAN);
        System.out.println(Color.ORANGE);
        System.out.println("==========");
        System.out.println(Color.PURPLE.getClass());
        System.out.println("==========");
        System.out.println(Color.CYAN.getClass().getSuperclass());
        System.out.println("==========");
        System.out.println(Color.ORANGE.getClass().getClass());
    }
}

enum Color
{
    RED(255, 0, 0, "Red"),
    ORANGE(255, 128, 0, "Orange"),
    YELLOW(255, 255, 0, "Yellow"),
    GREEN(0, 255, 0, "Green"),
    CYAN(0, 255, 255, "Cyan"),
    BLUE(0, 0, 255, "Blue"),
    PURPLE(128, 0, 255, "Purple");

    private final int red;
    private final int green;
    private final int blue;
    private final String description;

    private Color(int red, int green, int blue, String description)
    {
        this.red = red;
        this.green = green;
        this.blue = blue;
        this.description = description;
    }

    public int getRed() {
        return red;
    }

    public int getGreen() {
        return green;
    }

    public int getBlue() {
        return blue;
    }

    public String getDescription() {
        return description;
    }

    @Override
    public String toString()
    {
        return super.toString()+ '(' + this.red + ',' + this.green + ',' + this.blue + ')' + "->" + this.getDescription();
    }
}
